From: Florian Müllner Date: Mon, 4 Nov 2013 13:09:19 +0000 (+0100) Subject: screencast: Validate parameters of ScreencastArea X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~3078 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e8d9a4bd49e99a80797d0473b8b73f4aea1bbf29;p=gnome-shell.git screencast: Validate parameters of ScreencastArea ... just as we do for screenshots. https://bugzilla.gnome.org/show_bug.cgi?id=699752 --- diff --git a/js/ui/screencast.js b/js/ui/screencast.js index 23d6a4269..7908ff166 100644 --- a/js/ui/screencast.js +++ b/js/ui/screencast.js @@ -137,6 +137,16 @@ const ScreencastService = new Lang.Class({ if (!recorder.is_recording()) { let [x, y, width, height, fileTemplate, options] = params; + if (x < 0 || y < 0 || + width <= 0 || height <= 0 || + x + width > global.screen_width || + y + height > global.screen_height) { + invocation.return_error_literal(Gio.IOErrorEnum, + Gio.IOErrorEnum.CANCELLED, + "Invalid params"); + return; + } + recorder.set_file_template(fileTemplate); recorder.set_area(x, y, width, height); this._applyOptionalParameters(recorder, options);